package com.appleframework.project.demo.provider.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.appleframework.model.page.Pagination;
import com.appleframework.project.demo.common.entity.ClientDetails;
import com.appleframework.project.demo.common.model.ClientDetailsSo;
import com.appleframework.project.demo.common.service.ClientDetailsService;
import com.appleframework.project.demo.provider.dao.ClientDetailsDao;

@Service("clientDetailsService")
public class ClientDetailsServiceImpl implements ClientDetailsService {
	
	@Resource
	private ClientDetailsDao clientDetailsDao;
		
	@Override
	//@Cacheable(value = "oauthClientDetailCache", key = "'ClientDetails.clientId.' + #clientId")
    public ClientDetails loadClientByClientId(String clientId) {
		return clientDetailsDao.loadClientByClientId(clientId);
    }
	
	@Override
	public List<ClientDetails> findAll() {
		return clientDetailsDao.selectAll();
    }
	
	@Override
	public Pagination findByPage(Pagination page, ClientDetailsSo so) {
		page.setList(clientDetailsDao.selectByPage(page, so));
		return page;
    }
	
}
